package com.momo.upms.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.momo.common.core.constant.ServiceNameConstants;
import com.momo.common.core.request.PageParams;
import com.momo.common.core.result.Rs;
import com.momo.upms.condition.UserCondition;
import com.momo.upms.dto.UserDTO;
import com.momo.upms.vo.UserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = ServiceNameConstants.UPMS_SERVICE, contextId = "UserApi")
public interface UserApi {

    @PostMapping("/user/page")
    Rs<Page<UserVO>> pageUser(@RequestBody PageParams<UserCondition> userCondition);

    @PostMapping("/user/insert")
    Rs<UserVO> insertUser(@RequestBody UserDTO userDTO);

    @PostMapping("/user/update")
    Rs<UserVO> updateUser(@RequestBody UserDTO userDTO);

    @GetMapping(value = {"/user/get/{id}"})
    Rs<UserVO> getUser(@PathVariable("id") Long userId);

    @PostMapping(value = {"/user/delete/{id}"})
    Rs<Boolean> deleteUser(@PathVariable("id") Long userId);
}
